arm/x86: Use struct virtual_region to do bug, symbol, and (x86) exception tables...
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 10 Mar 2016 21:35:50 +0000 (16:35 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 29 Apr 2016 07:58:10 +0000 (03:58 -0400)
commit2aa925be84293b44ad587ed117184ace61b41dd6
tree8299207d95f9f3c3a82aaf7f5f3b637745951ec2
parent05bb8afedede3522cd27fa5feccfdc9f4fcbfbd5
arm/x86: Use struct virtual_region to do bug, symbol, and (x86) exception tables lookup.

During execution of the hypervisor we have two regions of
executable code - stext -> _etext, and _sinittext -> _einitext.

The later is not needed after bootup.

We also have various built-in macros and functions to search
in between those two swaths depending on the state of the system.

That is either for bug_frames, exceptions (x86) or symbol
names for the instruction.

With xSplice in the picture - we need a mechanism for new payloads
to searched as well for all of this.

Originally we had extra 'if (xsplice)...' but that gets
a bit tiring and does not hook up nicely.

This 'struct virtual_region' and virtual_region_list provide a
mechanism to search for the bug_frames, exception table,
and symbol names entries without having various calls in
other sub-components in the system.

Code which wishes to participate in bug_frames and exception table
entries search has to only use two public APIs:
 - register_virtual_region
 - unregister_virtual_region

to let the core code know.

If the ->lookup_symbol is not then the default internal symbol lookup
mechanism is used.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com> [ARM]
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/arm/setup.c
xen/arch/arm/traps.c
xen/arch/x86/extable.c
xen/arch/x86/setup.c
xen/arch/x86/traps.c
xen/common/Makefile
xen/common/symbols.c
xen/common/virtual_region.c [new file with mode: 0644]
xen/include/xen/symbols.h
xen/include/xen/virtual_region.h [new file with mode: 0644]